<%@ page import="dart.Classification" %>
<% classes = Classification.findAllByEnabled(!disabled, [sort:"scoreMultiplier", order:"asc"]) %>

<html>
<head>
	<title>Classes</title>
	<meta name="layout" content="dart"/>
	<dart:css src="classification.css"/>
</head>
<body>
<h1>${disabled ? "Disabled " : ""}Classes</h1>
<table cellspacing="0" id="list">
	<thead>
		<tr>
			<th class="classification">Name</th>
			<th>Score</th>
			<th>Penalty</th>
		</tr>
	</thead>
	<g:each in="${classes}" var="classification">
		<tr>
			<td class="classification">
				<g:link action="editClass" id="${classification.id}"> ${classification.name} </g:link>
			</td>
			<td class="multiplier">
				${classification.scoreMultiplier}
			</td>
			<td class="multiplier">
				${classification.penaltyMultiplier}
			</td>
		</tr>
	</g:each>
	<g:if test="${!disabled}">
		<tr class="end">
			<td class="classification">
				<g:link action="createClass">New Class</g:link>
			</td>
			<td class="multiplier"></td>
			<td class="multiplier"></td>
		</tr>
	</g:if>
</table>
<p>
	<g:if test="${disabled}">
		<g:link action="listClasses">Show Enabled Classes</g:link>
	</g:if>
	<g:else>
		<g:link action="listClasses" params="${[disabled: true]}">Show Disabled Classes</g:link>
	</g:else>
</p>
</body>
</html>
